2.4 The Bootstrap Method and Empirical Confidence Intervals
compute a confidence interval around a performance estimate to judge its certainty – or uncertainty
「汎化性能の確からしさ(または不確からしさ)を判断するために、汎化性能の見積りに関する信頼区間を計算したい」
the idea behind the bootstrap is to generate "new samples" by sampling from an empirical distribution.
「ブートストラップの背後にあるアイデアは、実証に基づいた分布からサンプリングすることで"新たなサンプル"を生成するというもの」
原義: pull oneself up by one's bootstrap「自力で困難を乗り越える」(ウィズダム英和辞典)
The bootstrap method is a resampling technique for estimating a sampling distribution
「ブートストラップ法は、サンプリング分布を見積もるためのリサンプリグ技術」
In brief, the idea of the bootstrap method is to generate new data from a population by repeated sampling from the original dataset with replacement
「ブートストラップ法のアイデアは、元々のデータセットから繰り返し復元(with replacement)サンプリングすることで母集団から新しいデータを生成するというもの」
repeated holdout methodは復元しない(without replacement)サンプリングと理解される
ブートストラップ法のステップ
1. サイズnのデータセットが与えられる
2. b回のブートストラップの各回で
1つの単一のサンプルをデータセットから取り出し、j番目のブートストラップサンプルに割り当てる
ブートストラップサンプルのサイズがnになるまで繰り返す
毎回、同一の元々のデータセットからサンプルを取り出す(復元抽出)
ブートストラップサンプルには複数回登場するサンプルもあるかもしれないし、1回も登場しないサンプルもあるかもしれない
3. b個のブートストラップサンプルそれぞれについて、モデルを訓練し、resubstitution accuracyを計算する
訓練データ(ブートストラップサンプル)でaccuracyを出す
楽観的なバイアスとなりがち
4. b個のaccuracyの見積りを渡っての平均として、モデルのaccuracyを計算する
we may prefer a slightly different approach to bootstrapping using the so-called Leave-One-Out Bootstrap (LOOB) technique.
「Leave-One-Out Bootstrap (LOOB)と呼ばれる技術を使う、ブートストラップのわずかに異なるアプローチの方を好むかもしれない」
we use out-of-bag samples as test sets for evaluation instead of evaluating the model on the training data
「訓練データでモデルを評価する代わりに、評価のためのテストセットとして袋の外のサンプルを使う」
ブートストラップ法のステップにおける「1回も登場しないサンプル」をテストセットとする!
サンプル xi は正規分布から取り出されたと仮定
xの平均を母集団平均の点推定として使う
母集団分散の推定 VAR
標準誤差(standard error: SE)
標準偏差の推定 SD
t検定の話?
サンプル数 n=100、t95 = 1.984(t-table参照。95%信頼区間)
Similarly, we can compute the 95% confidence interval of the bootstrap estimate starting with the mean accuracy,
上と同様に「平均のaccuracyから始めることで、ブートストラップ推定の95%信頼区間を計算できる」
ACC_boot: b回のブートストラップのACCの平均
SE_boot: ACC_iとACC_bootから標準誤差を計算
compute the confidence interval around the mean estimate
平均推定の信頼区間を計算
ACC_boot ± t × SE_boot
percentile method
ここまでの理論化では正規分布に従うとしていたが、サンプルが正規分布に従わないとする
.632 Estimate, a further improvement to address the pessimistic bias of the bootstrap cross-validation approach
Efron氏が「ブートストラップ交差検証アプローチの悲観的なバイアスに取り組むためにさらなる改善」したのが.632 Estimate
the bootstrap samples only contain approximately 63.2% of the unique examples from the original dataset
「ブートストラップサンプルには、元々のデータセットの一意なサンプルの約63.2%しか含まれない」
あるサンプルがサイズnのデータセットに選ばれない確率は(1 - 1/n) ** n
nを∞に近づけた時、この確率は1/e ≒ 0.368
選ばれる確率が1 - (1 - 1/n) ** nなのでnを大きくすると0.632に近づく
we select approximately 0.632 × n unique examples as bootstrap training sets and reserve 0.382 × n out-of-bag examples for testing in each iteration
「繰り返しの各回で、約0.632 × nの一意のサンプルをブートストラップの訓練セットとして選び、0.382× nをテスト用の袋の外のサンプルに取っておく」
ブートストラップでは、訓練に63.2%のデータしか使わない→訓練データが少ないのでモデルがcapacityに達しておらず、accuracyの推定に悲観的なバイアスがかかりうる
式 (34) (0.632 · ACC_h,i + 0.368 · ACC_r,i)のb回にわたる平均
ACC_h,iは袋の外のサンプルに対するaccuracy
ACC_r,iはresubstitution accuracy
訓練データでのaccuracyとテストデータでのaccuracyの重み付き和で補正している
.632+ Estimate
an optimistic bias may occur with models that tend to overfit
係数0.632で悲観的なバイアスに取り組んだが、楽観的なバイアスによりモデルが過学習することも起こりうる
式 (35)(36):weightを0.632とする代わりにrelative overfitting rate R を使って算出
Rはγ (no-information rate)から決まる(式 (37))
we can compute γ by fitting a model to a dataset that contains all possible combinations between samples x′i and target class labels yi
γはpkとqkから求められる!
クラスK個にわたってpk(1 - qk)の総和を取る
pk is the proportion of class k examples observed in the dataset, and qk is the proportion of class k examples that the classifier predicts in the dataset.
「pkはデータセットに観測されるクラスkのサンプルの割合」(真のクラス)
「qkは分類器がデータセットについて推論したクラスkのサンプルの割合」(予測クラス)
The OOB bootstrap, 0.632 bootstrap, and .632+ boostrap method discussed in this section are implemented in MLxtend to enable comparison studies.